package com.holly.unit.monitor.system.controller;

import com.holly.unit.core.pojo.response.ResponseData;
import com.holly.unit.core.pojo.response.SuccessResponseData;
import com.holly.unit.monitor.system.SystemHardwareCalculator;
import com.holly.unit.monitor.system.holder.SystemHardwareInfoHolder;
import com.holly.unit.scanner.api.annotation.ApiResource;
import com.holly.unit.scanner.api.annotation.GetResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 系统监控控制器
 *
 * @author holly
 * @date 2021/4/14 18:44
 */
@RestController
@ApiResource(name = "监控的控制器")
@Api(tags = "监控的控制器")
public class MonitorStatusController {

    @Resource
    private SystemHardwareInfoHolder systemHardwareInfoHolder;

    /**
     * 将应用设为默认应用，用户进入系统会默认进这个应用的菜单
     *
     * @author holly
     * @date 2020/6/29 16:49
     */
    @ApiOperation(value = "获取系统信息" ,notes = "获取系统信息")
    @GetResource(name = "获取系统信息", path = "/getSystemInfo")
    public ResponseData getSystemInfo() {
        SystemHardwareCalculator systemHardwareInfo = systemHardwareInfoHolder.getSystemHardwareInfo();
        return new SuccessResponseData(systemHardwareInfo);
    }

}
